class OptPlugin {
    apply(compiler) {
        compiler.hooks.compilation.tap('OptPlugin', (compilation) => {

            compilation.hooks.optimizeChunks.tap("OptPlugin2", function (chunks) {
                // console.log("The compilation is starting to optimize files...", compilation.chunks, this, source);
                console.log("The compilation is starting to optimize files...", chunks);
            });
            // for (let file in compilation.assets) {
            //     let text = '/**Sweet Banner**/  \n' + compilation.assets[file]._value;
            //     compilation.assets[file] = {
            //         source: function () {
            //             return text;
            //         },
            //         size: function () {
            //             return text.length;
            //         }
            //     }
            // }
            return true;
        });

    }
}
module.exports = OptPlugin;